<!DOCTYPE html>
<html lang="zh-CN" ng-app="ngApp" class="ng-scope">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>Template</title>
    <!-- Bootstrap -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询（media queries）功能 -->
    <!-- 警告：通过 file:// 协议（就是直接将 html 页面拖拽到浏览器中）访问页面时 Respond.js 不起作用 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<div ng-controller="mainCtrl">
    <nav class="navbar navbar-default navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <a class="navbar-brand" href="#" len="12" lang="zh" ng-bind="title"></a>
            </div>
        </div>
    </nav>
	
    <div class="container" style="margin-top: 70px;padding:0 20px 0 20px">
        <!-- exception -->
        <div ng-if="type==1">
            <form class="form-horizontal">
                <div class="form-group">
                    <label for="exceptionMsgShipname" class="col-xs-3 control-label">船名:</label>
                    <div class="col-xs-9">
                        <p type="text" id="exceptionMsgShipname">{{formatShipName(redata.mmsi)}}</p>
                    </div>
                </div>
                <div class="form-group">
                    <label for="exceptionMsgTimestamp" class="col-xs-3 control-label">时间:</label>
                    <div class="col-xs-9">
                        <p type="text" id="exceptionMsgTimestamp">{{redata.timestamp}}</p>
                    </div>
                </div>
                <div class="form-group">
                    <label for="exceptionMsgCode" class="col-xs-3 control-label">code:</label>
                    <div class="col-xs-9">
                        <p type="text" id="exceptionMsgCode">{{redata.code}}</p>
                    </div>
                </div>
                <div class="form-group">
                    <label for="exceptionMsgDetail" class="col-xs-3 control-label">详情:</label>
                    <div class="col-xs-9">
                        <p type="text" id="exceptionMsgDetail">{{redata.detail}}</p>
                    </div>
                </div>
            </form>
        </div>
        <!-- cctv -->
        <div ng-if="type==2">
            <form class="form-horizontal">
                <div class="form-group">
                    <label for="cctvShipname" class="col-xs-3 control-label">船名:</label>
                    <div class="col-xs-9">
                        <p type="text" id="cctvShipname">{{formatShipName(redata.mmsi)}}</p>
                    </div>
                </div>
                <div class="form-group">
                    <label for="cctvTimestamp" class="col-xs-3 control-label">时间:</label>
                    <div class="col-xs-9">
                        <p type="text" id="cctvTimestamp">{{redata.timeStamp| date:'yyyy-MM-dd HH:mm:ss'}}</p>
                    </div>
                </div>
                <div class="form-group">
                    <label for="cctvImage" class="col-xs-3 control-label">图片（点击查看大图):</label>
                    <div class="col-xs-9">
                        <p type="text" id="cctvImage">
                            <img ng-click="detailModal(redata.imageName)" data-toggle="modal" data-target="#detailModal" src="http://test.wechat.inuorui.com/api/data/checkIn/cctv/image?name={{redata.imageName}}" width="50px" height="50px">
                        </p>
                    </div>
                </div>
            </form>
        </div>
        <!-- checkin -->
        <div ng-if="type=='checkin'">
            <form class="form-horizontal">
                <div class="form-group">
                    <label for="checkinShipname" class="col-xs-3 control-label">船名:</label>
                    <div class="col-xs-9">
                        <p type="text" id="checkinShipname">{{redata.shipName}}</p>
                    </div>
                </div>
                <div class="form-group">
                    <label for="checkinSailor" class="col-xs-3 control-label">船员:</label>
                    <div class="col-xs-9">
                        <p type="text" id="checkinSailor">{{redata.sailorName}}</p>
                    </div>
                </div>
                <div class="form-group">
                    <label for="checkinTimestamp" class="col-xs-3 control-label">时间:</label>
                    <div class="col-xs-9">
                        <p type="text" id="checkinTimestamp">{{redata.checkInTime | date:'yyyy-MM-dd HH:mm:ss'}}</p>
                    </div>
                </div>
                <div class="form-group">
                    <label for="checkinState" class="col-xs-3 control-label">状态:</label>
                    <div class="col-xs-9">
                        <p type="text" id="checkinState">{{redata.state}}</p>
                    </div>
                </div>
                <div class="form-group">
                    <label for="checkinRemark" class="col-xs-3 control-label">备注:</label>
                    <div class="col-xs-9">
                        <p type="text" id="checkinRemark">{{formatMsg(redata.remark)}}
                            <button ng-if='redata.remark.length > 15' class="btn btn-default btn-sm"
                                    href="#" data-toggle="modal" data-target="#detailModal"
                                    ng-click="detailModal(redata.remark)">查看详情
                            </button>
                        </p>
                    </div>
                </div>
            </form>
        </div>
        <!-- 详情弹出框 -->
        <div id='detailModal' class="modal fade" tabindex="-1" role="dialog">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                aria-hidden="true">&times;</span></button>
                        <!--<h4 class="modal-title">Modal title</h4>-->
                    </div>
                    <div class="modal-body">
                        <p ng-if="type!=2">{{modalContent}}</p>
                        <img ng-if="type==2" src="{{modalContent}}" width="100%" height="100%"/>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->
    </div>
</div>
<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
<script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>

<!-- angularjs -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.2/angular.js"></script>
<script src="//unpkg.com/@uirouter/angularjs/release/angular-ui-router.min.js"></script>
<script src="static/js/detail.js"></script>
</body>
</html>